Troubleshoot Common ODE Problems 您所在的位置:网站首页 grid size with error tolerance Troubleshoot Common ODE Problems

Troubleshoot Common ODE Problems

2024-02-22 04:40| 来源: 网络整理| 查看: 265

First, check that tspan is not too long. Remember that the solver uses as many time points as necessary to produce a smooth solution. If the ODE function changes on a time scale that is very short compared to tspan, then the solver uses a lot of time steps. Long-time integration is a hard problem. Break tspan into smaller pieces.

If the ODE function does not change noticeably on the tspan interval, it could be that your problem is stiff. Try using one of the stiff solvers ode15s, ode23s, ode23t, or ode23tb.

Finally, make sure that the ODE function is written in an efficient way. The solvers evaluate the derivatives in the ODE function many times. The cost of numerical integration depends critically on the expense of evaluating the ODE function. Rather than recomputing complicated constant parameters at each evaluation, store them in global variables, or calculate them once and pass them to nested functions.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有